package com.zut.demo1.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//拦截器
public class AuthInterceptor implements HandlerInterceptor {

    /**
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        String username = (String) request.getSession().getAttribute("username");
        if(username != null && !"".equals(username)){
            return true;
        }
        response.getWriter().print("Access denied!");
        return false;
    }*/
}
